<template>
    <div>
        <h1>tab切换栏</h1>
        <div @click="tab='OneTab'">第一个</div>
        <div @click="tab='TwoTab'">第二个</div>
        <div @click="tab='ThreeTab'">第三个</div>
     <keep-alive>
        <component :is=tab></component>
     </keep-alive>
    </div>
</template>
<script>
import OneTab from '@/components/OneTab.vue';
import TwoTab from '@/components/TwoTab.vue';
import ThreeTab from '@/components/ThreeTab.vue';
export default {
  components:{
    OneTab,
    TwoTab,
    ThreeTab
  },
  data(){
    return{
        tab:""
    }
  }
}
</script>
<style>
</style>
